from django.urls import path
from rest_framework.routers import DefaultRouter
from . import views

router = DefaultRouter()
# 在这里添加ViewSet路由

urlpatterns = [
    # 账单管理
    path('bills/', views.bill_list, name='bill_list'),
    path('bills/<int:pk>/', views.bill_detail, name='bill_detail'),
    path('bills/<int:pk>/pay/', views.pay_bill, name='pay_bill'),
    path('bills/create/', views.create_bill, name='create_bill'),
    path('user-bills/', views.user_bills, name='user_bills'),  # 新增：获取当前用户的账单

    # 合同管理
    path('contracts/create/', views.create_contract, name='create_contract'),
    path('contracts/<int:contract_id>/generate-attachment/', views.generate_contract_attachment, name='generate_contract_attachment'),
    path('contracts/<int:contract_id>/approve/', views.approve_contract, name='approve_contract'),

    # Dashboard统计接口
    path('bills/monthly-count/', views.bill_monthly_count, name='bill_monthly_count'),  # 本月账单数量
    path('contracts/count/', views.contract_count, name='contract_count'),  # 合同总数
]

urlpatterns += router.urls 